package cj.web.kly.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cj.web.kly.dao.FriendlyLinkDAO;
import cj.web.kly.domain.FriendlyLink;

@Service
public class FriendlyLinkService {

	@Autowired
    private FriendlyLinkDAO friendlyLinkDAO;
	
	public List<FriendlyLink> queryAll(){
		return friendlyLinkDAO.queryAll();
	}
	
	/**
	 * 查询
	 * @param friendlyLink
	 * @return specialistLabellis;size
	 */
	public Map query(FriendlyLink friendlyLink){
		Map rep = new HashMap();
		List<FriendlyLink> categorylis = friendlyLinkDAO.query(friendlyLink);
		int size = friendlyLinkDAO.querySize(friendlyLink); 
		rep.put("friendlyLinklis", categorylis);
		rep.put("size", size);
		return rep;
    }
	
	public FriendlyLink queryById(int id){
		FriendlyLink obj = friendlyLinkDAO.queryById(id);
		return obj;
    }
	
	public void create(FriendlyLink friendlyLink){
		friendlyLinkDAO.create(friendlyLink);
	}
	
	public void update(FriendlyLink friendlyLink){
		friendlyLinkDAO.update(friendlyLink);
	}
	
	public void deleteById(int id){
		friendlyLinkDAO.deleteById(id);
	}
}
